var myApp = angular.module('portfolio-app', []);
myApp.config(['$httpProvider', function($httpProvider) {
	$httpProvider.defaults.useXDomain = true;
	delete $httpProvider.defaults.headers.common['X-Requested-With'];
}]);

function PortfolioCtrl($scope, $http) {
	$scope.items = [];
	$scope.loading = true;
	$scope.done = false;
	$http({
		method : 'GET',
		url : 'https://spreadsheets.google.com/feeds/list/0AgPdwaRwADWMdHZlN3hQS29WZHg2TFdPNHF1eEdIRXc/1/public/values?alt=json'
	}).success(function(data, status, headers, config) {
		angular.forEach(data.feed.entry, function(item) {
			var x = new Object();
			x.text = item.gsx$text.$t;
			x.media = item.gsx$media.$t;
			x.extra = item.gsx$extra.$t;
			$scope.items.push(x);
			$scope.loading = false;
			$scope.done = true;
		});
	}).error(function(data, status, headers, config) {
		console.log("error");
	});
}